function UserReducer(state={user:{id:1,name:"xiaowang",role:"超级管理员"}},action){
    console.log("UserReducer",action);
    switch(action.type){
        case "UPDATEUSER":
            state.user.name = action.payload
            return {...state}
        case "INITUSER":
            state.user = action.payload
            return {...state}
        default:
            return state
    }
}

export default UserReducer